const mongoose = require('mongoose')

const Comment = mongoose.model('Comment', new mongoose.Schema({
  aid: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Article',
    required: true
  },
  uid: {
    // 这里可以使用 Schema.Types.ObjectId 也可以使用 Schema.ObjectId 两者差不多 但是好像前者更好 更提倡使用
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User',
    required: true
  },
  time: {
    type: Date
  },
  content: {
    type: String
  }
}))

module.exports.Comment = Comment